package com.rightsidetech.trade.service;

import com.github.pagehelper.PageInfo;
import com.rightsidetech.commom.base.MonthQueryRequest;
import com.rightsidetech.commom.base.ResponseData;
import com.rightsidetech.commom.dto.response.AdminHomeTopResp;
import com.rightsidetech.commom.dto.response.AgentHomeTopResp;
import com.rightsidetech.trade.dtos.request.*;
import com.rightsidetech.trade.dtos.response.*;
import com.rightsidetech.trade.entity.*;

import java.math.BigDecimal;
import java.util.List;

public interface TdCommodityUserOrderService {
    ResponseData<PageInfo<TdCommodityUserOrderResp>> page(TdCommodityOrderListRequest request);

    ResponseData<PageInfo<TdCommodityUserOrderAgentResp>> agentPage(TdCommodityOrderListRequest request);

    List<TdCommodityUserOrderResp> selectList(TdCommodityOrderListRequest request);

    ResponseData<TdCommodityDetailResp> getByOrderId(Long id);

    ResponseData<TdCommodityDetailResp> getByOrderIdAndAgentId(Long id,Long agentId);

    ResponseData placeOrder(TdCommodityUserOrder tdCommodityUserOrder, List<TdCommodityOrderDetails> list, List<TdCommodityOrderDetails> list2,List<TdCommodityUserGiftRecord> list3, Long userInfoId);

    ResponseData updateOrder(String orderNo, String otherOrderNo, byte tradeChannel);

    ResponseData updateOrderStatus(String orderNo);

    TdCommodityUserOrder findByOrderNo(String orderNo);

    ResponseData<PageInfo<TdCommodityAppOrderListResp>> findAppOrderByOrderStatus(TdCommodityUserAppListRequest req, Long userInfoId, String paramValue);


    PageInfo<TdCommodityStoreAppListResp> findOrderByStore(TdCommodityStoreAppListRequest req);

    ResponseData receiveOrder(String orderNo, Long storeId);

    TdCommodityStoreOrderDetailResp findStoreOrderDetailByOrderNo(String orderNo, Long storeId,Long agentId);

    ResponseData updateOrderAddress(String orderNo, String userName, String userPhone, String address, BigDecimal longitude,BigDecimal latitude);

    ResponseData<TdCommodityAppOrderAfterServiceResp> findUserOrderByOrderNo(String orderNo,Long userInfoId, String paramValue);

    PageInfo<TdCommodityStoreAppListResp> storeOrderPage(TdCommodityAgentAppRequest req);

    TdCommodityAgentAppResp storeOrderStatis(Long agentId,Long storeId);

    Long selectFinishTotalOrderNumByStoreId(Long storeId);

    Long selectFinishTodayOrderNumByStoreId(Long storeId);

    ResponseData cancelOrderByorderNo(String orderNo);

    ResponseData<PageInfo<TdCommodityAfterPageResp>> afterServicePage(TdCommodityAfterServiceReq req) throws Exception;

    List<TdCommodityAfterPageResp> selectAfterServiceList(TdCommodityAfterServiceReq req) throws Exception;

    ResponseData<TdCommodityAfterServiceDetailResp> findAfterServiceDetailById(Long id);

    ResponseData updateOrderMsg(TdCommodityUpdateOrderMsgReq req, String storeName,Long agentId,String agentName,Long areaId,String areaName);

    List<TdCommodityOrderDetails> findOrderDetailByOrderNo(String orderNo);

    ResponseData applyAfterService(TdCommodityApplyAfterServiceReq req, String paramValue, Long userInfoId);

    ResponseData cancelAfterService(TdCommodityCancelReq req);

    ResponseData checkAfterService(TdCheckAfterServiceReq req,Long storeId,Long storeLoginId,String storeLoginName);

    //同意退款
    ResponseData agreeAfterService(TdCheckAfterServiceReq req,Long storeId,Long storeLoginId,String storeLoginName);

    TdCommodityTradeOrder selectTradeOrderByOrderNo(String orderNo);

    AdminHomeTopResp orderStatis(Long areaId);

    List<HomeSpscSaleResp> todaySpecSale(Long areaId,Long agentId);

    List<HomeAgentSaleResp> todayAgentRanking(Long areaId);

    ResponseData<List<HomeMonthSaleResp>> monthSale(MonthQueryRequest request, Long areaId, Long agentId);

    ResponseData<List<HomeMonthOrderResp>> monthOrder(MonthQueryRequest request, Long areaId);

    ResponseData addShoppingCar(TdCommodityBuyCardRequest req, Long userInfoId);

    ResponseData removeShoppingCar(List<Long> ids, Long userInfoId);

    ResponseData<List<HomeMonthOrderResp>> thisMonthOrder(Long agentInfoId);

    List<TdBuyCarResp> selectByUserInfoId(Long userInfoId,Long storeId);

    List<TdBuyCarDetailResp> selectBuyCarDetailList(Long buyCarId, String commodityTag);

    List<TdBuyCarDetailDelResp> selectBuyCarDetailZPList(Long buyCarId, String commodityTag);

    List<TdBuyCarDetailZpResp> selectZPByBuyCarIdAndParentId(Long buyCarId, Long parentId);

    ResponseData delShoppingCarByMoreCondition(List<TdBuyCarDetail> tdBuyCarDetails, Long storeId, Long userInfoId);

    ResponseData<PageInfo<TdCommodityBillResp>> findCommodityBillPage(TdCommodityBillReq req);

    ResponseData<PageInfo<TdCommodityBillAgentResp>> findCommodityBillAgentPage(TdCommodityBillReq req);

    List<TdCommodityTradeOrderResp> findCommodityBillList(TdCommodityTradeOrderReq req);

    List<HomeStoreSaleResp> todayStoreSale(Long agentInfoId);

    AgentHomeTopResp orderStatisByAgentId(Long agentInfoId);

    ResponseData insetTdCommodityList(List<TdCommodityUserOrder> orderList, List<TdCommodityOrderDetails> orderDetailsList);

    ResponseData addZPShoppingCar(List<TdAddUpdateBuyCarDetailZPReq> zpList);

    List<Long> selectZPIdsByParentId(Long parentId);

    ResponseData<TdCommodityUserOrderZpResp> getOrderDetailTrackNo(String orderNo);

    ResponseData updateTrackNoById(TdCommodityUpdateTrackNoReq req,Long loginId,String loginName) throws Exception;

    ResponseData delZpByParentId(Long parentId);

    int updateTdCommodityUserOrder(TdCommodityUserOrder tdCommodityUserOrder);

    List<TdCommodityOrderDetails> findCommodityByOrderNo(String orderNo, byte commodityTag);

    TdBuyCar findTdBuyCarBybuyCarId(Long buyCarId);

    TdBuyCarDetail findTdBuyCarDetailByParentId(Long parentId);

    TdBuyCarDetail findTdBuyCarDetailById(Long id);

    TdCommodityUserOrder selectByOtherPaltformsOrderNo(String otherPaltformsOrderNo);

    List<TdCommodityOrderDetails> findTdOrderDetailByParentId(Long parentId,byte commodityTag);

    List<TdCommodityOrderDetails> detailsByOrder(String orderNo);

    TdUserOrderInfoResp selectOrderById(Long id);

    void updateStoreNameByStoreId(Long storeId,String storeName);

    TdCommodityAppOrderAfterServiceResp selectByOrderNoAndUserInfoId(String orderNo,Long userInfoId);

    ResponseData<PageInfo<CommodityUserGiftResp>> giftPage(TdCommodityGiftOrderReq req);

    ResponseData<PageInfo<TdCommodityTradeOrderResp>> listTradeOrder(TdCommodityTradeOrderReq req);

    ResponseData<PageInfo<TdCommodityAfterServiceMoneyResp>> afterServiceMoneyPage(TdCommodityAfterServiceMoneyReq req);
    /**
     * 售后记录
     * @param req
     * @return
     */
    PageInfo<AppAfterSaleRecordResp> selectByStoreId(AppAfterSaleRecordReq req);

    List<TdCommodityAfterServiceMoneyResp> selectAfterServiceMoneyList(TdCommodityAfterServiceMoneyReq req);

    UserAppAfterSaleRecordResp selectByUserInfoId(Long userInfoId);
}
